package com.szq.netty.client;

import com.szq.netty.domain.MsgBody;
import io.netty.channel.ChannelInitializer;
import io.netty.channel.socket.SocketChannel;
import io.netty.handler.codec.protobuf.ProtobufDecoder;
import io.netty.handler.codec.protobuf.ProtobufVarint32FrameDecoder;

/**
 * @ClassName: MyChannelInitializer
 * @Description:
 * @Author: szq
 * @Date: 2021-11-12 09:48:46
 */
public class MyChannelInitializer extends ChannelInitializer<SocketChannel> {

    @Override
    protected void initChannel(SocketChannel channel) throws Exception {
        channel.pipeline().addLast(new ProtobufVarint32FrameDecoder());
//        channel.pipeline().addLast(new ProtobufDecoder(MsgBody.getDefaultInstance()));
    }
}
